package br.com.vti.sisp_sicrim.antigo.util;

import java.util.Set;

import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.core.RequestInfo;
import br.com.caelum.vraptor.ioc.Component;
import br.com.caelum.vraptor.ioc.RequestScoped;
import br.com.caelum.vraptor.resource.HttpMethod;
import br.com.caelum.vraptor.resource.MethodNotAllowedHandler;

@Component
@RequestScoped
public class Erro405 implements MethodNotAllowedHandler {
	private Result result;

	public Erro405(Result result) {
		this.result = result;
	}

	@Override
	public void deny(RequestInfo requestInfo, Set<HttpMethod> httpMethods) {
		result.include("mensagem", "Opera��o n�o permitida");
		UtilBean.redireciona("../include/erro.jsp", result, getClass().getSimpleName().toUpperCase());
	}
}